-
Notifications
You must be signed in to change notification settings - Fork 965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parallelize the unit tests #16206
Parallelize the unit tests #16206
Conversation
Problem with coverage measurements Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: This file could probably live somewhere other than the repo root, as long as it gets copied into the right place at container time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Since this file is being mounted in docker-compose.yml
, we could place it in dev/
and mount it from there, but that would skip it from being run in CI.
I'm not opposed to leaving it where it is for now, but wanted to call that possibility out.
Looks like the speedup isn't as significant on CI, which is interesting. Edit: For comparison, a random test run before this PR: https://github.com/pypi/warehouse/actions/runs/9762910094/job/26947742230 ...and with this PR: https://github.com/pypi/warehouse/actions/runs/9762940705/job/26947794957?pr=16206 So 4m30s to 2m58s. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Since this file is being mounted in docker-compose.yml
, we could place it in dev/
and mount it from there, but that would skip it from being run in CI.
I'm not opposed to leaving it where it is for now, but wanted to call that possibility out.
Is there maybe a way to locally disable this? For whatever reason, starting up the xdist workers on my machine made the test suite run take longer than it did before this change. I'm also missing the output which shows which test files failed as the test suite runs, as they're no longer displayed. |
This should disable parallelization (by forcing everything onto one worker): I'll look into improving the failure render as well. Edit: For improving the render you could pass |
FWIW, looks like |
Opening this o/b/o @DarkaMaul from @miketheman's original work.
On my local machine, this results in a ~2 speedup in testing: from roughly 2 minutes for the entire suite to 1. More speedups may be possible, e.g. in stand-up and coverage merging.
Closes #16178.